﻿using FytSoa.Common.Utils;
using FytSoa.Domain.Core.Result;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace FytSoa.Application.Sys;

public interface ISysFileService:IApplicationService
{
    /// <summary>
    /// 查询目录-树形结构
    /// </summary>
    /// <param name="path"></param>
    /// <returns></returns>
    ApiResult<List<FileUtils.FileDirectory>> GetDirectory(string path);

    /// <summary>
    /// 根据目录查询文件
    /// </summary>
    /// <param name="path"></param>
    /// <returns></returns>
    ApiResult<List<FileUtils.ArrayFiles>> GetList(string path);

    /// <summary>
    /// 根据目录查询文件
    /// </summary>
    /// <returns></returns>
    ApiResult<List<FileUtils.FilesInfo>> GetFiles(string path);
    
    /// <summary>
    /// 上传文件
    /// </summary>
    /// <returns></returns>
    Task<ApiResult<SysFileDto>> Upload([FromForm]IFormFile file, string path);
    
    /// <summary>
    /// 删除文件
    /// </summary>
    /// <returns></returns>
    ApiResult<bool> DeleteFile(string path);
    
    /// <summary>
    /// 删除目录及目录下文件
    /// </summary>
    /// <returns></returns>
    ApiResult<bool> DeleteDirectory(string path);
}